/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package network;

import java.util.List;
import weibo4j.Friendships;
import weibo4j.Users;
import weibo4j.Weibo;
import weibo4j.model.User;
import weibo4j.model.WeiboException;

/**
 *
 * @author Administrator
 */


public class celebrity  {

    public static void main(String[] args) throws WeiboException {
        String accesstoken = Auth.Auth4Code.getCode();
        Weibo weibo = new Weibo();
        weibo.setToken(accesstoken);
        Friendships fm = new Friendships();
        String uid = Config.uid;
        String username = Config.username;
        Users um = new Users();
        User me = um.showUserById(uid);
        int fcount = me.getFriendsCount();
        int focount = me.getFollowersCount();
        int bfcount = me.getbiFollowersCount();
        int pages = fcount / 200 + 2;
        int count = 0;
        for (int i = 0; i <= pages; i++) {
            List<User> users = fm.getFriendsByID(uid, 200, 200 * i + 1);
            for (User s : users) {
                int fans = s.getFollowersCount();
                int friends = s.getFriendsCount();
                double a = 0;
                a = (double)friends / fans;
                String yes = "no";
                if (fans > 10000 && a<0.15) {
                    yes = "yes";
                }
                System.out.println(s.getName() + " " + fans + " " + friends + " " + a + " " + yes);
                count += 1;
            }
        }
        System.out.println(count + " " + fcount + " " + focount + " " + bfcount);
    }
}
